var a = require("../../utils/api.js"), t = getApp();

Page({
    data: {
        sysHeight: t.globalData.windowHeight
    },
    onLoad: function(o) {
        var e = this;
        a.GetContentArticle({
            openid: t.globalData.openid,
            cid: o.id
        }).then(function(a) {
            console.log(a), 0 == a.errno ? (console.log(2222), a.data.length < 20 && a.data.length > 0 ? (e.setData({
                info: a.data,
                page: 0,
                cid: o.id
            }), console.log(e.data.info)) : 0 == a.data.length ? e.setData({
                showNo: !0,
                page: 0
            }) : (e.setData({
                info: a.data,
                page: 2,
                cid: o.id
            }), console.log(e.data.info))) : e.setData({
                showNo: !0,
                page: 0
            });
        });
    },
    toDetail: function(a) {
        var t = a.currentTarget.dataset.id;
        wx.navigateTo({
            url: "/pages/personal/qualificationDetail?id=" + t
        });
    },
    scrolltolower: function() {
        var o = this, e = o.data.page, n = o.data.info, i = o.data.cid;
        console.log(e), e && (console.log(333), a.GetContentArticle({
            openid: t.globalData.openid,
            cid: i,
            page: e
        }).then(function(a) {
            console.log(a), a.data.length < 20 ? e = 0 : e += 1, o.setData({
                info: n,
                page: e
            }), console.log(o.data.info);
        }));
    }
});